import { defHttp } from '../http'
import type { CommonAPI } from '../model/_utils'

// 账号登录
export const signInApi = data =>
  defHttp.post('/session', { data }, { isTransformResponse: false })

// 修改登录账号密码
export const updatePasswordApi: CommonAPI<
  '/v1/account/password',
  'put'
> = data =>
  defHttp.put('/account/password', { data }, { isTransformResponse: false })

// 退出登录
export const signOutApi: CommonAPI<'/v1/session', 'delete'> = () =>
  defHttp.delete('/session')
